<template>
  <el-card>
    <el-form
      :model="ruleForm"
      :rules="rules"
      ref="ruleForm"
      size="mini"
      label-width="130px"
    >
      <el-row>
        <el-col :span="8" class="right-margin">
          <el-form-item label="公司名称:" prop="name">
            <el-select v-model="ruleForm.name" placeholder="请选择">
              <el-option
                label="北京天气真好科技有限公司"
                value="shanghai"
              ></el-option>
              <el-option
                label="北京天气真好科技北京分公司"
                value="beijing"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="币种:" prop="currency">
            <el-select v-model="ruleForm.currency" placeholder="请选择">
              <el-option label="人民币" value="shanghai"></el-option>
              <el-option label="美元" value="beijing"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="8" class="right-margin">
          <el-form-item label="收货公司:" prop="receiptCompany">
            <el-select v-model="ruleForm.receiptCompany" placeholder="请选择">
              <el-option
                label="北京天气真好科技集团有限公司"
                value="shanghai"
              ></el-option>
              <el-option
                label="北京天气真好北京分公司"
                value="beijing"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="付款公司:" prop="payCompany">
            <el-select v-model="ruleForm.payCompany" placeholder="请选择">
              <el-option
                label="北京天气真好科技集团有限公司"
                value="shanghai"
              ></el-option>
              <el-option
                label="北京天气真好北京分公司"
                value="beijing"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="8" class="right-margin">
          <el-form-item label="发票类型:" prop="billType">
            <el-select v-model="ruleForm.billType" placeholder="请选择">
              <el-option label="增值税发票" value="shanghai"></el-option>
              <el-option label="普通发票" value="beijing"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="结算条件:" prop="payConditions">
            <el-select v-model="ruleForm.payConditions" placeholder="请选择">
              <el-option label="先款后货" value="shanghai"></el-option>
              <el-option label="先货后款" value="beijing"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="8" class="right-margin">
          <el-form-item label="付款方式:" prop="payType">
            <el-select v-model="ruleForm.payType" placeholder="请选择">
              <el-option label="微信" value="shanghai"></el-option>
              <el-option label="支付宝" value="beijing"></el-option>
              <el-option label="信用卡" value="beijing"></el-option>
              <el-option label="电汇" value="beijing"></el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="8" class="right-margin">
          <el-form-item label="发货方式:" prop="delivery">
            <el-select v-model="ruleForm.delivery" placeholder="请选择">
              <el-option label="手动发货" value="shanghai"></el-option>
              <el-option label="整单发货" value="beijing"></el-option>
              <el-option label="货到即发" value="beijing"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="8" class="right-margin">
          <el-form-item label="货运类型:" prop="freightType">
            <el-select v-model="ruleForm.freightType" placeholder="请选择">
              <el-option label="快递" value="shanghai"></el-option>
              <el-option label="物流" value="beijing"></el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="运费负担方:" prop="freightCarrier">
            <el-select v-model="ruleForm.freightCarrier" placeholder="请选择">
              <el-option label="卖方" value="shanghai"></el-option>
              <el-option label="我方" value="beijing"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="8" class="right-margin">
          <el-form-item label="承运商:" prop="carrier">
            <el-select v-model="ruleForm.carrier" placeholder="请选择">
              <el-option label="顺丰" value="shanghai"></el-option>
              <el-option label="ems" value="beijing"></el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="地址信息:" prop="address">
            <div style="display: flex">
              <el-select v-model="ruleForm.address" placeholder="请选择">
                <el-option
                  label="北京市xx区xxx街道xxxxx小区 xxx 18800006666"
                  value="shanghai"
                ></el-option>
                <el-option
                  label="北京市xx区xxx街道xxxxx小区 xxx 18800006666"
                  value="beijing"
                ></el-option>
              </el-select>

              <el-button
                style="margin-left: 10px"
                type="primary"
                icon="el-icon-plus"
                circle
                @click="add"
              ></el-button>
            </div>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </el-card>
</template>

<script>
export default {
  name: "FormDataCard",
  components: {},
  data() {
    return {
      ruleForm: {
        name: "", //公司名称
        currency: "", //币种
        receiptCompany: "", //收货公司
        payCompany: "", //付款公司
        billType: "", //发票类型
        payConditions: "", //结算条件
        payType: "", //付款方式
        delivery: "", //发货方式
        freightType: "", //货运类型
        freightCarrier: "", //运费负担方
        carrier: "", //承运商
        address: "", //地址
      },
      rules: {
        name: [{ required: true, message: "请填写公司信息", trigger: "blur" }],
        currency: [{ required: true, message: "币种", trigger: "change" }],
        receiptCompany: [
          { required: true, message: "请选择收货公司", trigger: "change" },
        ],
        payCompany: [
          { required: true, message: "请选择付款公司", trigger: "change" },
        ],
        billType: [
          { required: true, message: "请选择发票类型", trigger: "change" },
        ],
        payConditions: [
          { required: true, message: "请选择结算条件", trigger: "change" },
        ],
        payType: [
          { required: true, message: "请选择付款方式", trigger: "change" },
        ],
        delivery: [
          { required: true, message: "请选择发货方式", trigger: "change" },
        ],
        freightType: [
          { required: true, message: "请选择货运类型", trigger: "change" },
        ],
        freightCarrier: [
          { required: true, message: "请选择运费负担方", trigger: "change" },
        ],

        address: [
          { required: true, message: "请选择地址信息", trigger: "change" },
        ],
        carrier: [
          { required: true, message: "请选择承运商", trigger: "change" },
        ],
      },
    };
  },
  methods: {
    add(){
      this.$emit("addAddress")
    }
  },
  created() {},
};
</script>
<style lang="scss" scoped>
.right-margin {
  margin-right: 150px;
}
.el-form-item {
  margin-right: 0 !important;
}
.el-form-item__label {
  position: absolute;
}
.el-form-item__content {
  width: 100%;
  padding-left: 80px;
}
.el-select,
.el-input_inner {
  width: 100%;
}
</style>
